// source --> http://marketingonlineseo.ro/wp-content/cache/asset-cleanup/js/head-80c1916f1dd67c90f60d5951a6a15145c4efb78a-2.js /*** Source: /wp-content/cache/asset-cleanup/js/min/easy-facebook-likebox-popup-script-v4.3.8.js ***/ /*** Source (before minification): /wp-content/plugins/easy-facebook-likebox/public/assets/popup/jquery.magnific-popup.min.js ***/ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):window.jQuery||window.Zepto)}(function(a){var b,c,d,e,f,g,h,i="Close",j="BeforeClose",k="AfterClose",l="BeforeAppend",m="MarkupParse",n="Open",o="Change",p="mfp",q="."+p,r="mfp-ready",s="mfp-removing",t="mfp-prevent-close",u=function(){},v=!!window.jQuery,w=a(window),x=function(a,c){b.ev.on(p+a+q,c)},y=function(b,c,d,e){var f=document.createElement("div");return f.className="mfp-"+b,d&&(f.innerHTML=d),e?c&&c.appendChild(f):(f=a(f),c&&f.appendTo(c)),f},z=function(c,d){b.ev.triggerHandler(p+c,d),b.st.callbacks&&(c=c.charAt(0).toLowerCase()+c.slice(1),b.st.callbacks[c]&&b.st.callbacks[c].apply(b,a.isArray(d)?d:[d]))},A=function(c){return c===h&&b.currTemplate.closeBtn||(b.currTemplate.closeBtn=a(b.st.closeMarkup.replace("%title%",b.st.tClose)),h=c),b.currTemplate.closeBtn},B=function(){a.magnificPopup.instance||(b=new u,b.init(),a.magnificPopup.instance=b)},C=function(){var a=document.createElement("p").style,b=["ms","O","Moz","Webkit"];if(void 0!==a.transition)return!0;for(;b.length;)if(b.pop()+"Transition"in a)return!0;return!1};u.prototype={constructor:u,init:function(){var c=navigator.appVersion;b.isIE7=-1!==c.indexOf("MSIE 7."),b.isIE8=-1!==c.indexOf("MSIE 8."),b.isLowIE=b.isIE7||b.isIE8,b.isAndroid=/android/gi.test(c),b.isIOS=/iphone|ipad|ipod/gi.test(c),b.supportsTransition=C(),b.probablyMobile=b.isAndroid||b.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),e=a(document),b.popupsCache={}},open:function(c){d||(d=a(document.body));var f;if(c.isObj===!1){b.items=c.items.toArray(),b.index=0;var h,i=c.items;for(f=0;f(a||w.height())},_setFocus:function(){(b.st.focus?b.content.find(b.st.focus).eq(0):b.wrap).focus()},_onFocusIn:function(c){return c.target===b.wrap[0]||a.contains(b.wrap[0],c.target)?void 0:(b._setFocus(),!1)},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),z(m,[b,c,d]),a.each(c,function(a,c){if(void 0===c||c===!1)return!0;if(e=a.split("_"),e.length>1){var d=b.find(q+"-"+e[0]);if(d.length>0){var f=e[1];"replaceWith"===f?d[0]!==c[0]&&d.replaceWith(c):"img"===f?d.is("img")?d.attr("src",c):d.replaceWith(''):d.attr(e[1],c)}}else b.find(q+"-"+a).html(c)})},_getScrollbarSize:function(){if(void 0===b.scrollbarSize){var a=document.createElement("div");a.style.cssText="width:99px;height:99px;overflow:scroll;position:absolute;top:-9999px;",document.body.appendChild(a),b.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return b.scrollbarSize}},a.magnificPopup={instance:null,proto:u.prototype,modules:[],open:function(b,c){return B(),b=b?a.extend(!0,{},b):{},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading..."}},a.fn.magnificPopup=function(c){B();var d=a(this);if("string"==typeof c)if("open"===c){var e,f=v?d.data("magnificPopup"):d[0].magnificPopup,g=parseInt(arguments[1],10)||0;f.items?e=f.items[g]:(e=d,f.delegate&&(e=e.find(f.delegate)),e=e.eq(g)),b._openClick({mfpEl:e},d,f)}else b.isOpen&&b[c].apply(b,Array.prototype.slice.call(arguments,1));else c=a.extend(!0,{},c),v?d.data("magnificPopup",c):d[0].magnificPopup=c,b.addGroup(d,c);return d};var D,E,F,G="inline",H=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(G,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){b.types.push(G),x(i+"."+G,function(){H()})},getInline:function(c,d){if(H(),c.src){var e=b.st.inline,f=a(c.src);if(f.length){var g=f[0].parentNode;g&&g.tagName&&(E||(D=e.hiddenClass,E=y(D),D="mfp-"+D),F=f.after(E).detach().removeClass(D)),b.updateStatus("ready")}else b.updateStatus("error",e.tNotFound),f=a("
");return c.inlineElement=f,f}return b.updateStatus("ready"),b._parseMarkup(d,{},c),d}}});var I,J="ajax",K=function(){I&&d.removeClass(I)},L=function(){K(),b.req&&b.req.abort()};a.magnificPopup.registerModule(J,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){b.types.push(J),I=b.st.ajax.cursor,x(i+"."+J,L),x("BeforeChange."+J,L)},getAjax:function(c){I&&d.addClass(I),b.updateStatus("loading");var e=a.extend({url:c.src,success:function(d,e,f){var g={data:d,xhr:f};z("ParseAjax",g),b.appendContent(a(g.data),J),c.finished=!0,K(),b._setFocus(),setTimeout(function(){b.wrap.addClass(r)},16),b.updateStatus("ready"),z("AjaxContentAdded")},error:function(){K(),c.finished=c.loadError=!0,b.updateStatus("error",b.st.ajax.tError.replace("%url%",c.src))}},b.st.ajax.settings);return b.req=a.ajax(e),""}}});var M,N=function(c){if(c.data&&void 0!==c.data.title)return c.data.title;var d=b.st.image.titleSrc;if(d){if(a.isFunction(d))return d.call(b,c);if(c.el)return c.el.attr(d)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var a=b.st.image,c=".image";b.types.push("image"),x(n+c,function(){"image"===b.currItem.type&&a.cursor&&d.addClass(a.cursor)}),x(i+c,function(){a.cursor&&d.removeClass(a.cursor),w.off("resize"+q)}),x("Resize"+c,b.resizeImage),b.isLowIE&&x("AfterChange",b.resizeImage)},resizeImage:function(){var a=b.currItem;if(a&&a.img&&b.st.image.verticalFit){var c=0;b.isLowIE&&(c=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",b.wH-c)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,M&&clearInterval(M),a.isCheckingImgSize=!1,z("ImageHasSize",a),a.imgHidden&&(b.content&&b.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var c=0,d=a.img[0],e=function(f){M&&clearInterval(M),M=setInterval(function(){return d.naturalWidth>0?void b._onImageHasSize(a):(c>200&&clearInterval(M),c++,void(3===c?e(10):40===c?e(50):100===c&&e(500)))},f)};e(1)},getImage:function(c,d){var e=0,f=function(){c&&(c.img[0].complete?(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("ready")),c.hasSize=!0,c.loaded=!0,z("ImageLoadComplete")):(e++,200>e?setTimeout(f,100):g()))},g=function(){c&&(c.img.off(".mfploader"),c===b.currItem&&(b._onImageHasSize(c),b.updateStatus("error",h.tError.replace("%url%",c.src))),c.hasSize=!0,c.loaded=!0,c.loadError=!0)},h=b.st.image,i=d.find(".mfp-img");if(i.length){var j=document.createElement("img");j.className="mfp-img",c.el&&c.el.find("img").length&&(j.alt=c.el.find("img").attr("alt")),c.img=a(j).on("load.mfploader",f).on("error.mfploader",g),j.src=c.src,i.is("img")&&(c.img=c.img.clone()),j=c.img[0],j.naturalWidth>0?c.hasSize=!0:j.width||(c.hasSize=!1)}return b._parseMarkup(d,{title:N(c),img_replaceWith:c.img},c),b.resizeImage(),c.hasSize?(M&&clearInterval(M),c.loadError?(d.addClass("mfp-loading"),b.updateStatus("error",h.tError.replace("%url%",c.src))):(d.removeClass("mfp-loading"),b.updateStatus("ready")),d):(b.updateStatus("loading"),c.loading=!0,c.hasSize||(c.imgHidden=!0,d.addClass("mfp-loading"),b.findImageSize(c)),d)}}});var O,P=function(){return void 0===O&&(O=void 0!==document.createElement("p").style.MozTransform),O};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a,c=b.st.zoom,d=".zoom";if(c.enabled&&b.supportsTransition){var e,f,g=c.duration,h=function(a){var b=a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+c.duration/1e3+"s "+c.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,b.css(e),b},k=function(){b.content.css("visibility","visible")};x("BuildControls"+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.content.css("visibility","hidden"),a=b._getItemToZoom(),!a)return void k();f=h(a),f.css(b._getOffset()),b.wrap.append(f),e=setTimeout(function(){f.css(b._getOffset(!0)),e=setTimeout(function(){k(),setTimeout(function(){f.remove(),a=f=null,z("ZoomAnimationEnded")},16)},g)},16)}}),x(j+d,function(){if(b._allowZoom()){if(clearTimeout(e),b.st.removalDelay=g,!a){if(a=b._getItemToZoom(),!a)return;f=h(a)}f.css(b._getOffset(!0)),b.wrap.append(f),b.content.css("visibility","hidden"),setTimeout(function(){f.css(b._getOffset())},16)}}),x(i+d,function(){b._allowZoom()&&(k(),f&&f.remove(),a=null)})}},_allowZoom:function(){return"image"===b.currItem.type},_getItemToZoom:function(){return b.currItem.hasSize?b.currItem.img:!1},_getOffset:function(c){var d;d=c?b.currItem.img:b.st.zoom.opener(b.currItem.el||b.currItem);var e=d.offset(),f=parseInt(d.css("padding-top"),10),g=parseInt(d.css("padding-bottom"),10);e.top-=a(window).scrollTop()-f;var h={width:d.width(),height:(v?d.innerHeight():d[0].offsetHeight)-g-f};return P()?h["-moz-transform"]=h.transform="translate("+e.left+"px,"+e.top+"px)":(h.left=e.left,h.top=e.top),h}}});var Q="iframe",R="//about:blank",S=function(a){if(b.currTemplate[Q]){var c=b.currTemplate[Q].find("iframe");c.length&&(a||(c[0].src=R),b.isIE8&&c.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(Q,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){b.types.push(Q),x("BeforeChange",function(a,b,c){b!==c&&(b===Q?S():c===Q&&S(!0))}),x(i+"."+Q,function(){S()})},getIframe:function(c,d){var e=c.src,f=b.st.iframe;a.each(f.patterns,function(){return e.indexOf(this.index)>-1?(this.id&&(e="string"==typeof this.id?e.substr(e.lastIndexOf(this.id)+this.id.length,e.length):this.id.call(this,e)),e=this.src.replace("%id%",e),!1):void 0});var g={};return f.srcAction&&(g[f.srcAction]=e),b._parseMarkup(d,g,c),b.updateStatus("ready"),d}}});var T=function(a){var c=b.items.length;return a>c-1?a-c:0>a?c+a:a},U=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=b.st.gallery,d=".mfp-gallery",f=Boolean(a.fn.mfpFastClick);return b.direction=!0,c&&c.enabled?(g+=" mfp-gallery",x(n+d,function(){c.navigateByImgClick&&b.wrap.on("click"+d,".mfp-img",function(){return b.items.length>1?(b.next(),!1):void 0}),e.on("keydown"+d,function(a){37===a.keyCode?b.prev():39===a.keyCode&&b.next()})}),x("UpdateStatus"+d,function(a,c){c.text&&(c.text=U(c.text,b.currItem.index,b.items.length))}),x(m+d,function(a,d,e,f){var g=b.items.length;e.counter=g>1?U(c.tCounter,f.index,g):""}),x("BuildControls"+d,function(){if(b.items.length>1&&c.arrows&&!b.arrowLeft){var d=c.arrowMarkup,e=b.arrowLeft=a(d.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(t),g=b.arrowRight=a(d.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(t),h=f?"mfpFastClick":"click";e[h](function(){b.prev()}),g[h](function(){b.next()}),b.isIE7&&(y("b",e[0],!1,!0),y("a",e[0],!1,!0),y("b",g[0],!1,!0),y("a",g[0],!1,!0)),b.container.append(e.add(g))}}),x(o+d,function(){b._preloadTimeout&&clearTimeout(b._preloadTimeout),b._preloadTimeout=setTimeout(function(){b.preloadNearbyImages(),b._preloadTimeout=null},16)}),void x(i+d,function(){e.off(d),b.wrap.off("click"+d),b.arrowLeft&&f&&b.arrowLeft.add(b.arrowRight).destroyMfpFastClick(),b.arrowRight=b.arrowLeft=null})):!1},next:function(){b.direction=!0,b.index=T(b.index+1),b.updateItemHTML()},prev:function(){b.direction=!1,b.index=T(b.index-1),b.updateItemHTML()},goTo:function(a){b.direction=a>=b.index,b.index=a,b.updateItemHTML()},preloadNearbyImages:function(){var a,c=b.st.gallery.preload,d=Math.min(c[0],b.items.length),e=Math.min(c[1],b.items.length);for(a=1;a<=(b.direction?e:d);a++)b._preloadItem(b.index+a);for(a=1;a<=(b.direction?d:e);a++)b._preloadItem(b.index-a)},_preloadItem:function(c){if(c=T(c),!b.items[c].preloaded){var d=b.items[c];d.parsed||(d=b.parseEl(c)),z("LazyLoad",d),"image"===d.type&&(d.img=a('').on("load.mfploader",function(){d.hasSize=!0}).on("error.mfploader",function(){d.hasSize=!0,d.loadError=!0,z("LazyLoadError",d)}).attr("src",d.src)),d.preloaded=!0}}}});var V="retina";a.magnificPopup.registerModule(V,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=b.st.retina,c=a.ratio;c=isNaN(c)?c():c,c>1&&(x("ImageHasSize."+V,function(a,b){b.img.css({"max-width":b.img[0].naturalWidth/c,width:"100%"})}),x("ElementParse."+V,function(b,d){d.src=a.replaceSrc(d,c)}))}}}}),function(){var b=1e3,c="ontouchstart"in window,d=function(){w.off("touchmove"+f+" touchend"+f)},e="mfpFastClick",f="."+e;a.fn.mfpFastClick=function(e){return a(this).each(function(){var g,h=a(this);if(c){var i,j,k,l,m,n;h.on("touchstart"+f,function(a){l=!1,n=1,m=a.originalEvent?a.originalEvent.touches[0]:a.touches[0],j=m.clientX,k=m.clientY,w.on("touchmove"+f,function(a){m=a.originalEvent?a.originalEvent.touches:a.touches,n=m.length,m=m[0],(Math.abs(m.clientX-j)>10||Math.abs(m.clientY-k)>10)&&(l=!0,d())}).on("touchend"+f,function(a){d(),l||n>1||(g=!0,a.preventDefault(),clearTimeout(i),i=setTimeout(function(){g=!1},b),e())})})}h.on("click"+f,function(){g||e()})})},a.fn.destroyMfpFastClick=function(){a(this).off("touchstart"+f+" click"+f),c&&w.off("touchmove"+f+" touchend"+f)}}(),B()}); /*** Source: /wp-content/cache/asset-cleanup/js/min/easy-facebook-likebox-cookie-script-v4.3.8.js ***/ /*** Source (before minification): /wp-content/plugins/easy-facebook-likebox/public/assets/js/jquery.cookie.js ***/ (function (factory){ if(typeof define==='function' && define.amd){ define(['jquery'],factory); }else if(typeof exports==='object'){ factory(require('jquery')); }else { factory(jQuery); }}(function ($){ var pluses = /\+/g;function encode(s){ return config.raw ? s:encodeURIComponent(s); } function decode(s){ return config.raw ? s:decodeURIComponent(s); } function stringifyCookieValue(value){ return encode(config.json ? JSON.stringify(value):String(value)); } function parseCookieValue(s){ if(s.indexOf('"')===0){ s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\'); } try { s=decodeURIComponent(s.replace(pluses,' ')); return config.json ? JSON.parse(s):s; }catch(e){}} function read(s,converter){ var value=config.raw ? s:parseCookieValue(s); return $.isFunction(converter) ? converter(value):value; } var config=$.cookie=function (key,value,options){ if(arguments.length > 1 && !$.isFunction(value)){ options=$.extend({},config.defaults,options); if(typeof options.expires==='number'){ var days=options.expires,t=options.expires=new Date();t.setTime(+t+days * 864e+5); } return (document.cookie=[ encode(key),'=',stringifyCookieValue(value), options.expires ? ';expires='+options.expires.toUTCString():'',// use expires attribute,max-age is not supported by IE options.path ? ';path='+options.path:'', options.domain ? ';domain='+options.domain:'', options.secure ? ';secure':'' ].join('')); } var result=key ? undefined:{}; var cookies=document.cookie ? document.cookie.split(';'):[]; for (var i=0,l=cookies.length;i < l;i++){ var parts=cookies[i].split('='); var name=decode(parts.shift()); var cookie=parts.join('='); if(key && key===name){ result=read(cookie,value);break; } if(!key && (cookie=read(cookie))!==undefined){ result[name]=cookie; }} return result; };config.defaults={}; $.removeCookie=function (key,options){ if($.cookie(key)===undefined){ return !1; } $.cookie(key,'',$.extend({},options,{expires:-1 })); return !$.cookie(key); }; })); /*** Source: /wp-content/cache/asset-cleanup/js/min/easy-facebook-likebox-public-script-v4.3.8.js ***/ /*** Source (before minification): /wp-content/plugins/easy-facebook-likebox/public/assets/js/public.js ***/ jQuery(document).ready(function($){ if($(".efbl_feed_wraper .efbl_custom_likebox")[0]||$(".widget_easy_facebook_page_plugin .efbl-like-box")[0] ){ if(typeof FB==='undefined'||FB===null){ setTimeout(function(){$('.efbl-loader').remove();},3000); } else{ FB.Event.subscribe('xfbml.render',function(response){ var animclasses=$('.efbl-like-box .fb-page').data('animclass'); $('.efbl-loader').remove(); $('.efbl-like-box iframe').addClass('animated '+animclasses); }); }} function efbl_render_poup_markup(object){ var $story_link =object.data('storylink'), $story_link_text =object.data('linktext'), $caption =object.data('caption'), $image_url =object.data('imagelink'), $iframe_vid_url =object.data('videolink'), $video_url =object.data('video'), $itemnumber =object.data('itemnumber'), $windowWidth =window.innerWidth, $windowHeight =window.innerHeight - 200; $('.white-popup .efbl_popup_left_container').css({ "width":"auto", "height":"auto", }); $('.efbl_popup_image').css('height','auto'); if($image_url){ $('#efblcf_holder .efbl_popup_image').attr('src',$image_url); $('#efblcf_holder .efbl_popup_image').css('display','block'); } if($iframe_vid_url){ $('#efblcf_holder .efbl_popup_if_video').attr('src',$iframe_vid_url); $('#efblcf_holder .efbl_popup_if_video').css({ 'display':'block', 'width':'720px', 'height':'400px' }); } if($video_url){ $('#efblcf_holder .efbl_popup_video').attr('src',$video_url); $('#efblcf_holder .efbl_popup_video').css('display','block');setTimeout(function(){ $('#efblcf_holder .efbl_popup_video')[0].play(); },500); } $('.efbl_feed_wraper #item_number').val($itemnumber); if($caption){ $('#efblcf_holder .efbl_popupp_footer').html('

'+$caption+'
'+$story_link_text+'

'); $('#efblcf_holder .efbl_popupp_footer').css('display','block'); }} function reset_popup_holder(){ $('#efblcf_holder .efbl_popup_image').attr('src',''); $('#efblcf_holder .efbl_popup_image').css('display','none'); $('#efblcf_holder .efbl_popup_if_video').attr('src',''); $('#efblcf_holder .efbl_popup_if_video').css('display','none'); $('#efblcf_holder .efbl_popup_video').attr('src',''); $('#efblcf_holder .efbl_popup_video').css('display','none'); $('#efblcf_holder .efbl_popupp_footer').html(''); $('#efblcf_holder .efbl_popupp_footer').css('display','none'); } $('.efbl_feed_popup').magnificPopup({ type:'ajax', tLoading:'Loading...', preloader:false, mainClass:'mfp-fade', callbacks:{ ajaxContentAdded:function(){ efbl_render_poup_markup(this.st.el); }, beforeOpen:function(){ }, beforeClose:function (){ reset_popup_holder(); }} }); $('.efbl_share_links').click(function(){ $(this).next('.efbl_links_container').slideToggle("slow"); }); $('.efbl_info').click(function(){ $(this).siblings('.efbl_comments_wraper').slideToggle("slow"); }); $('body').on('click','.efbl-popup-next',function(){ reset_popup_holder(); var $next_pre_itemnumber=$('.efbl_feed_wraper #item_number').val(); $next_pre_itemnumber=parseInt ($next_pre_itemnumber)+1; var feed_wraper_id=$(this).parents("#efblcf_holder" ).data('rand_id'); var numItems=$("#efbl_feed_"+feed_wraper_id+" .efbl_feed_popup" ).length if($next_pre_itemnumber > numItems){ $next_pre_itemnumber=1; } efbl_render_poup_markup($('.efbl-cff-item_number-'+$next_pre_itemnumber)); }); $('body').on('click','.efbl-popup-prev',function(){ reset_popup_holder(); var $next_pre_itemnumber=$('.efbl_feed_wraper #item_number').val(); var feed_wraper_id=$(this).parents("#efblcf_holder" ).data('rand_id'); var numItems=$("#efbl_feed_"+feed_wraper_id+" .efbl_feed_popup" ).length if($next_pre_itemnumber==1){ $next_pre_itemnumber=numItems; }else{ $next_pre_itemnumber=parseInt($next_pre_itemnumber) - 1; } efbl_render_poup_markup($('.efbl-cff-item_number-'+$next_pre_itemnumber)); });}); /*** Source: /wp-content/cache/asset-cleanup/js/min/Popup.js-v3.1.1.js ***/ /*** Source (before minification): /wp-content/plugins/popup-builder/public/js/Popup.js ***/ function SGPopup(config) {var integrations=config.integrations;var popupName=config.popupName;var initialConfig=config;var prefix=config.prefix||'sgpb';var isInited=!1;var mainDiv=null;var contentDiv=null;var DIV=null;var opened=!1;var resizeTimeout=null;var overlayDiv=null;var defaultZIndex=config.contentBox.zIndex||9999;var defaultWidth="640px";var defaultHeight=config.autoHeight;var closeButtonImage=null;var popupId=config.id;var showOnce=config.showOnce||false;var events=config.events||[];var openDelay=config.openDelay||0;var popupTheme=config.popupTheme;var popupType=config.popupType;var fitBackgroundImg=null;var openAnimation=config.openAnimation||{type:"none",speed:0};var closeAnimation=config.closeAnimation||{type:"none",speed:0};var closeBehavior=config.closeBehavior||{allowed:true,showButton:true,buttonPosition:'topLeft',buttonInside:true,autoclose:false,overlayShouldClose:true,contentShouldClose:false,escShouldClose:true};var closeButton=config.closeButton||{data:sgpbPublicUrl+'img/close.png',width:16,height:16,widthType:'px',heightType:'px',closeButtonType:'IMG',closeButtonText:'Close'};var overlay=config.overlay||{visible:true,color:"#000",opacity:0.7};var contentBox=config.contentBox||{padding:8,showBackground:true,backgroundColor:"#fff",borderStyle:"solid",borderColor:"#ccc",borderRadius:config.contentBox.borderRadius,borderRadiusType:config.contentBox.borderRadiusType,borderWidth:1,shadowColor:"#ccc",shadowSpread:0,shadowBlur:10,scrollingEnabled:true,backgroundPosition:''};var contents=config.contents||"";var inline=config.inline||false;var href=config.href||false;var position=config.position||{left:"center",top:"center"};if((typeof position.left=="undefined"||(isNaN(parseInt(position.left))&&position.left!="center"))&&(typeof position.right=="undefined"||(isNaN(parseInt(position.right))&&position.right!="center"))){position.left="center";} if((typeof position.top=="undefined"||(isNaN(parseInt(position.top))&&position.top!="center"))&&(typeof position.bottom=="undefined"||(isNaN(parseInt(position.bottom))&&position.bottom!="center"))){position.top="center";} var sizingRanges=config.sizingRanges||[{screenFrom:{width:-1,height:-1},screenTo:{width:-1,height:-1},width:defaultWidth,height:defaultHeight,maxWidth:-1,maxHeight:-1,minWidth:-1,minHeight:-1}];var shouldOpen=config.shouldOpen||function(){return !0;};var willOpen=config.willOpen||function(){};var didOpen=config.didOpen||function(){};var shouldClose=config.shouldClose||function(){return !0;};var willClose=config.willClose||function(){};var didClose=config.didClose||function(){};SGPopup.inlinePrevTarget=SGPopup.inlinePrevTarget||{};function resetInlineContent() {if(inline){var htmlElement=document.getElementById(inline);if(SGPopup.inlinePrevTarget.hasPreviousElement){if(typeof SGPopup.inlinePrevTarget.parentNode!='undefined'){SGPopup.inlinePrevTarget.parentNode.insertBefore(htmlElement,SGPopup.inlinePrevTarget.node.nextSibling);}} else{SGPopup.inlinePrevTarget.node.appendChild(htmlElement);}}} var OPEN_ANIMATION_POP="@-webkit-keyframes popin{from{-webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{-moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@keyframes popin{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}";var OPEN_ANIMATION_FADE="@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}";var OPEN_ANIMATION_FLIP="@-webkit-keyframes flipintoright{from{-webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{-moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@keyframes flipintoright{from{transform:rotateY(90deg) scale(.9)}to{transform:rotateY(0)}}";var OPEN_ANIMATION_SLIDELEFT="@-webkit-keyframes slideinfromright{from{-webkit-transform:translate3d({start},0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{-moz-transform:translateX({start})}to{-moz-transform:translateX(0)}}@keyframes slideinfromright{from{transform:translateX({start})}to{transform:translateX(0)}}";var OPEN_ANIMATION_SLIDERIGHT="@-webkit-keyframes slideinfromleft{from{-webkit-transform:translate3d({start},0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{-moz-transform:translateX({start})}to{-moz-transform:translateX(0)}}@keyframes slideinfromleft{from{transform:translateX({start})}to{transform:translateX(0)}}";var OPEN_ANIMATION_FLOW="@-webkit-keyframes flowinfromright{0%{-webkit-transform:translateX(100%) scale(.7)}30%,40%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(0) scale(1)}}@-moz-keyframes flowinfromright{0%{-moz-transform:translateX(100%) scale(.7)}30%,40%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(0) scale(1)}}@keyframes flowinfromright{0%{transform:translateX(100%) scale(.7)}30%,40%{transform:translateX(0) scale(.7)}100%{transform:translateX(0) scale(1)}}";var OPEN_ANIMATION_SLIDEUP="@-webkit-keyframes slideinfrombottom{from{-webkit-transform:translateY({start})}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfrombottom{from{-moz-transform:translateY({start})}to{-moz-transform:translateY(0)}}@keyframes slideinfrombottom{from{transform:translateY({start})}to{transform:translateY(0)}}";var OPEN_ANIMATION_SLIDEDOWN="@-webkit-keyframes slideinfromtop{from{-webkit-transform:translateY({start})}to{-webkit-transform:translateY(0)}}@-moz-keyframes slideinfromtop{from{-moz-transform:translateY({start})}to{-moz-transform:translateY(0)}}@keyframes slideinfromtop{from{transform:translateY({start})}to{transform:translateY(0)}}";var CLOSE_ANIMATION_SLIDELEFT="@-webkit-keyframes slideouttoleft{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d({end},0,0)}}@-moz-keyframes slideouttoleft{from{-moz-transform:translateX(0)}to{-moz-transform:translateX({end})}}@keyframes slideouttoleft{from{transform:translateX(0)}to{transform:translateX({end})}}";var CLOSE_ANIMATION_SLIDERIGHT="@-webkit-keyframes slideouttoright{from{-webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d({end},0,0)}}@-moz-keyframes slideouttoright{from{-moz-transform:translateX(0)}to{-moz-transform:translateX({end})}}@keyframes slideouttoright{from{transform:translateX(0)}to{transform:translateX({end})}}";var CLOSE_ANIMATION_POP="@-webkit-keyframes popout{from{-webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{-moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@keyframes popout{from{transform:scale(1);opacity:1}to{transform:scale(.8);opacity:0}}";var CLOSE_ANIMATION_FADE="@-webkit-keyframes fadeout{from{opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{opacity:1}to{opacity:0}}@keyframes fadeout{from{opacity:1}to{opacity:0}}";var CLOSE_ANIMATION_FLIP="@-webkit-keyframes flipouttoright{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@keyframes flipouttoright{from{transform:rotateY(0)}to{transform:rotateY(90deg) scale(.9)}}";var CLOSE_ANIMATION_FLOW="@-webkit-keyframes flowouttoright{0%{-webkit-transform:translateX(0) scale(1)}60%,70%{-webkit-transform:translateX(0) scale(.7)}100%{-webkit-transform:translateX(100%) scale(.7)}}@-moz-keyframes flowouttoright{0%{-moz-transform:translateX(0) scale(1)}60%,70%{-moz-transform:translateX(0) scale(.7)}100%{-moz-transform:translateX(100%) scale(.7)}}@keyframes flowouttoright{0%{transform:translateX(0) scale(1)}60%,70%{transform:translateX(0) scale(.7)}100%{transform:translateX(100%) scale(.7)}}";var CLOSE_ANIMATION_SLIDEUP="@-webkit-keyframes slideouttotop{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY({end})}}@-moz-keyframes slideouttotop{from{-moz-transform:translateY(0)}to{-moz-transform:translateY({end})}}@keyframes slideouttotop{from{transform:translateY(0)}to{transform:translateY({end})}}";var CLOSE_ANIMATION_SLIDEDOWN="@-webkit-keyframes slideouttobottom{from{-webkit-transform:translateY(0)}to{-webkit-transform:translateY({end})}}@-moz-keyframes slideouttobottom{from{-moz-transform:translateY(0)}to{-moz-transform:translateY({end})}}@keyframes slideouttobottom{from{transform:translateY(0)}to{transform:translateY({end})}}";function addAnimationClass(classString) {var style=document.createElement('style');style.type='text/css';style.innerHTML=classString;style.id=prefix+"-effect-custom-style";document.getElementsByTagName('head')[0].appendChild(style);} function setMainDivStyles(sizeConfig) {contentDiv.style.zIndex=defaultZIndex+10;mainDiv.style.boxSizing='content-box';if(sizeConfig.minHeight!=-1){var minHeight=sizeConfig.minHeight;var popupMinHeight=window.innerHeight;if(typeof minHeight=='string'&&minHeight.indexOf('%')!=-1){var popupMinhHeight=(popupMinhHeight/100)*parseInt(minHeight);mainDiv.style.minHeight=popupMinhHeight+'px';} else{mainDiv.style.minHeight=parseInt(minHeight)+'px';}} if(sizeConfig.minWidth!=-1){var popupMinhWidth=window.innerWidth;var minWidth=sizeConfig.minWidth;if(typeof minWidth=='string'&&minWidth.indexOf('%')!=-1){var popupMinhWidth=(popupMinhWidth/100)*parseInt(minWidth);mainDiv.style.minWidth=popupMinhWidth+'px';} else{mainDiv.style.minWidth=parseInt(minWidth)+'px';}} if(sizeConfig.maxHeight!=-1&&sizeConfig.maxHeight){var maxHeight=sizeConfig.maxHeight;var popupMaxHeight=window.innerHeight;if(maxHeight.indexOf('%')!=-1){var popupMaxHeight=(popupMaxHeight/100)*parseInt(maxHeight);this.calculatedMaxHeight=calculateMaxHeight(popupMaxHeight);mainDiv.style.maxHeight=this.calculatedMaxHeight;} else{this.calculatedMaxHeight=calculateMaxHeight(parseInt(maxHeight));mainDiv.style.maxHeight=this.calculatedMaxHeight;}} else{var popupMaxHeight=window.innerHeight;mainDiv.style.maxHeight=calculateMaxHeight(popupMaxHeight);} if(sizeConfig.maxWidth!=-1&&sizeConfig.maxWidth){var maxWidth=sizeConfig.maxWidth;var popupMaxWidth=window.innerWidth;if(maxWidth.indexOf('%')!=-1){var popupMaxWidth=(popupMaxWidth/100)*parseInt(maxWidth);this.calculatedMaxWidth=calculateMaxWidth(popupMaxWidth);mainDiv.style.maxWidth=this.calculatedMaxWidth;} else{this.calculatedMaxWidth=calculateMaxWidth(parseInt(maxWidth));mainDiv.style.maxWidth=this.calculatedMaxWidth;}} else{var popupMaxWidth=window.innerWidth;mainDiv.style.maxWidth=calculateMaxWidth(popupMaxWidth);} if(contentBox.borderStyle){mainDiv.style.borderStyle=contentBox.borderStyle;} if(contentBox.borderColor){mainDiv.style.borderColor=contentBox.borderColor;} if(contentBox.borderRadius){var borderRadiusMeasure='%';if(contentBox.borderRadiusType){var borderRadiusMeasure=contentBox.borderRadiusType;} mainDiv.style.borderRadius=contentBox.borderRadius+borderRadiusMeasure;} mainDiv.style.borderWidth=contentBox.borderWidth+"px";if(contentBox.padding){mainDiv.style.padding=contentBox.padding+"px";} var widthToSet=sizeConfig.width||defaultWidth;if(widthToSet.indexOf("%")>-1){var widthNum=parseFloat(widthToSet);var closeButtonWidthToSubtract=parseInt(closeButton.width);if(closeBehavior.showButton==false||config.closeButton.type=='button'){closeButtonWidthToSubtract=0;} widthToSet=(((widthNum/100)*window.innerWidth)-(2*(contentBox.padding?contentBox.padding:0))-parseFloat(mainDiv.style.borderLeftWidth)-parseFloat(mainDiv.style.borderRightWidth)-(parseFloat(contentBox.shadowSpread)/2)-closeButtonWidthToSubtract)+'px';} else{widthToSet=parseFloat(widthToSet)-2*(contentBox.padding?contentBox.padding:0)+'px';} mainDiv.style.width=widthToSet;if(config.popupType=='image'){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";} if(contentBox.showBackground){if(contentBox.backgroundImage){mainDiv.style.backgroundImage="url("+contentBox.backgroundImage+")";} if(contentBox.backgroundMode=="cover"){mainDiv.style.backgroundSize="cover";mainDiv.style.backgroundRepeat="no-repeat";} else if(contentBox.backgroundMode=="contain"){mainDiv.style.backgroundSize="contain";mainDiv.style.backgroundRepeat="no-repeat";} else if(contentBox.backgroundMode=="repeat"){mainDiv.style.backgroundRepeat="repeat";} else if(contentBox.backgroundMode=='fit'){if(!fitBackgroundImg){fitBackgroundImg=document.createElement('img');fitBackgroundImg.style.position='fixed';fitBackgroundImg.style.bottom='-9999999999999px';fitBackgroundImg.className='sgpb-background-image-'+config.popupId;document.body.appendChild(fitBackgroundImg);fitBackgroundImg.onload=function(){changePopupDimensionRelatedImage(this);};fitBackgroundImg.src=contentBox.backgroundImage;mainDiv.style.backgroundSize='100% 100%';mainDiv.style.backgroundRepeat='no-repeat';}} else{mainDiv.style.backgroundRepeat="no-repeat";}} if(window.sgWindowOldWidth!=window.innerWidth||window.sgWindowOldHeight!=window.innerHeight){window.sgWindowOldWidth=window.innerWidth;window.sgWindowOldHeight=window.innerHeight;var images=document.getElementsByClassName('sgpb-background-image-'+config.popupId);if(images.length){changePopupDimensionRelatedImage(images[0]);}} mainDiv.style.backgroundPosition=contentBox.backgroundPosition;var heightToSet=sizeConfig.height||defaultHeight;if(typeof heightToSet!='undefined'&&heightToSet.indexOf("%")>-1){var heightNum=parseFloat(heightToSet);heightToSet=(((heightNum/100)*window.innerHeight)-(2*(contentBox.padding?contentBox.padding:0))-parseInt(mainDiv.style.borderTopWidth)-parseInt(mainDiv.style.borderBottomWidth))+"px";} else{heightToSet=parseInt(heightToSet)-2*(contentBox.padding?contentBox.padding:0)+"px";} mainDiv.style.height=heightToSet;if(contentBox.showBackground&&contentBox.backgroundColor){mainDiv.style.backgroundColor=contentBox.backgroundColor;} if(contentBox.shadowColor){mainDiv.style.boxShadow="0 0 "+contentBox.shadowBlur+"px "+contentBox.shadowSpread+"px "+contentBox.shadowColor;} if(contentBox.scrollingEnabled){mainDiv.style.overflow="auto";} else{mainDiv.style.overflow="hidden";}} function changePopupDimensionRelatedImage(image) {var result=resizeConfig(image);var oldSizeConfig=getSizeConfig();oldSizeConfig.width=result.width+'px';oldSizeConfig.height=result.height+'px';oldSizeConfig.modified=!0;this.sizeConfig=oldSizeConfig;windowResizeHandler();} function resizeConfig(backgroundImage) {var maxWidth=parseInt(this.calculatedMaxWidth);var maxHeight=parseInt(this.calculatedMaxHeight);var imageWidth=backgroundImage.width;var imageHeight=backgroundImage.height;var windowMaxHeight=parseInt(calculateMaxHeight(window.innerHeight));var windowMaxWidth=parseInt(calculateMaxWidth(window.innerWidth));if(isNaN(maxHeight)||maxHeight>windowMaxHeight){maxHeight=windowMaxHeight;} if(isNaN(maxWidth)||maxWidth>windowMaxWidth){maxWidth=windowMaxWidth;} var widthDifference=imageWidth-maxWidth;var heightDifference=imageHeight-maxHeight;if(heightDifference>widthDifference){if(imageHeight>maxHeight){var modifiedHeightPercent=100-(maxHeight/imageHeight)*100;var withMustDecrease=(imageWidth*modifiedHeightPercent)/100;var modifiedWidth=imageWidth-withMustDecrease;imageWidth=modifiedWidth;imageHeight=maxHeight;}} else if(imageWidth>maxWidth){var modifiedWidthPercent=Math.floor((widthDifference/imageWidth)*100);var heightMustDecrease=Math.floor((imageHeight*modifiedWidthPercent)/100);var modifiedHeight=imageHeight-heightMustDecrease;imageWidth-=widthDifference;imageHeight-=heightMustDecrease;} var result={width:imageWidth,height:imageHeight};return result;} function calculateMaxWidth(maxWidth) {var contentPadding=(contentBox.padding||0)*2;var shadowSpread=(contentBox.shadowSpread||0)*2;var borderWidth=(contentBox.borderWidth||0)*2;var boxBorderWidth=(contentBox.boxBorderWidth||0)*4;var closeButtonRight=(parseInt(closeBehavior.right)||0)*2;var closeButtonLeft=(parseInt(closeBehavior.left)||0)*2;maxWidth-=contentPadding;maxWidth-=34;maxWidth-=shadowSpread;maxWidth-=borderWidth;maxWidth-=boxBorderWidth;if(!closeBehavior.buttonInside){if(closeButtonRight){maxWidth-=Math.abs(closeButtonRight);} if(closeButtonLeft){maxWidth-=Math.abs(closeButtonLeft);}} if(maxWidth<0){return'30px';} return maxWidth+'px';} function setFitBackground() {if(!fitBackgroundImg)return;var imgHeight=fitBackgroundImg.height;var imgWidth=fitBackgroundImg.width;var winHeight=window.innerHeight;var winWidth=window.innerWidth;var minMargin=40;var popupWidth=0,popupHeight=0;if(imgWidth<(winWidth-2*minMargin)&&imgHeight<(winHeight-2*minMargin)){popupWidth=imgWidth;popupHeight=imgHeight;}else{var widthDif=winWidth-imgWidth;var heightDif=winHeight-imgHeight;if(widthDiftmpConf.screenFrom.width)||(windowWidthtmpConf.screenFrom.width)){candidates.push(tmpConf);}} for(var i=0;itmpConf.screenFrom.height)||(windowHeighttmpConf.screenFrom.height)){continue;} else{candidates.splice(i,1);i--;}} config=candidates[0];if(!config){config={screenFrom:{width:-1,height:-1},screenTo:{width:-1,height:-1},width:"640px",height:defaultHeight,maxWidth:-1,maxHeight:-1,minWidth:-1,minHeight:-1}} return config;} function drawOverlay() {if(!overlay.visible){return;} overlayDiv=document.createElement("DIV");overlayDiv.style.zIndex=defaultZIndex;overlayDiv.style.backgroundColor=overlay.color;overlayDiv.style.opacity=overlay.opacity/100;overlayDiv.style.position="fixed";overlayDiv.style.left="0";overlayDiv.style.top="0";overlayDiv.style.width="100%";overlayDiv.style.height="100%";if(overlay.addClass){overlayDiv.className=overlay.addClass;} if(closeBehavior.overlayShouldClose){overlayDiv.onclick=closePopup;} document.body.appendChild(overlayDiv);} function removeOverlay() {if(overlayDiv){overlayDiv.style.display="none";document.body.removeChild(overlayDiv);overlayDiv=null;}} function setCloseButton(mainDiv) {if(!closeButton.data){return;} if(closeBehavior.showButton===false){return;} closeButtonImage.style.zIndex=defaultZIndex+20;closeButtonImage.style.position="absolute";closeButtonImage.style.float="left";closeButtonImage.style.top=closeBehavior.top;closeButtonImage.style.right=closeBehavior.right;closeButtonImage.style.bottom=closeBehavior.bottom;closeButtonImage.style.left=closeBehavior.left;if(closeButton.type=='button'){closeButtonImage.id=prefix+'-close-button';closeButtonImage.innerHTML=config.closeButton.text;} closeButtonImage.style.width=closeButton.width+closeButton.widthType;closeButtonImage.style.cursor="pointer";closeButtonImage.style.height=closeButton.height+closeButton.heightType;closeButtonImage.src=closeButton.data;closeButtonImage.style.backgroundRepeat="no-repeat";closeButtonImage.style.backgroundSize="cover";closeButtonImage.onclick=closePopup;positionCloseButton(mainDiv);} function positionCloseButton(mainDiv) {if(closeBehavior.buttonPosition=="left"){closeButtonImage.style.left=(closeButton.width/2+parseFloat(closeBehavior.leftPosition))+"px";} else if(closeBehavior.buttonPosition=="right"){var border=contentBox.borderWidth||0;var left=0;var mainDivWidth=mainDiv.style.width;if(mainDiv.style.maxWidth&&parseInt(mainDivWidth)>parseInt(mainDiv.style.maxWidth)){mainDivWidth=mainDiv.style.maxWidth;} left=parseFloat(mainDivWidth)-Math.ceil(closeButton.width/2)+2*contentBox.padding+2*border;if(closeBehavior.leftPosition){left=left-parseFloat(closeBehavior.leftPosition);} closeButtonImage.style.left=left+"px";} closeButtonImage.style.top=parseFloat(closeBehavior.topPosition)+"px";} function onWindowRsize() {clearTimeout(resizeTimeout);resizeTimeout=setTimeout(function(){resizeBox();positionPopup();positionCloseButton(mainDiv);jQuery(window).trigger('sgpbPopupReload')},0);} function windowResizeHandler() {resizeBox();positionPopup();positionCloseButton(mainDiv);jQuery(window).trigger('sgpbPopupReload')} function setOpenAnimation() {if(!openAnimation.status){return !1;} contentDiv.style.animationTimingFunction="linear";var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;if(openAnimation.type=="slideleft"){var start=window.innerWidth-parseInt(contentDiv.style.left)+2*border;addAnimationClass(OPEN_ANIMATION_SLIDELEFT.replace(/\{start\}/g,start+"px"));contentDiv.style.animationName="slideinfromright";} else if(openAnimation.type=="slideright"){var start=parseInt(mainDiv.style.width)+parseInt(contentDiv.style.left)+2*border+2*padding;addAnimationClass(OPEN_ANIMATION_SLIDERIGHT.replace(/\{start\}/g,"-"+start+"px"));contentDiv.style.animationName="slideinfromleft";} else if(openAnimation.type=="pop"){addAnimationClass(OPEN_ANIMATION_POP);contentDiv.style.transform="scale(1)";contentDiv.style.animationName="popin";contentDiv.style.opacity="1";} else if(openAnimation.type=="fade"){addAnimationClass(OPEN_ANIMATION_FADE);contentDiv.style.animationName="fadein";contentDiv.style.opacity="1";} else if(openAnimation.type=="flip"){addAnimationClass(OPEN_ANIMATION_FLIP);contentDiv.style.animationName="flipintoright";contentDiv.style.transform="translateX(0)";} else if(openAnimation.type=="turn"){addAnimationClass(OPEN_ANIMATION_FLIP);contentDiv.style.animationName="flipintoright";contentDiv.style.transform="translateX(0)";contentDiv.style.transformOrigin="0";} else if(openAnimation.type=="flow"){addAnimationClass(OPEN_ANIMATION_FLOW);contentDiv.style.animationName="flowinfromright";contentDiv.style.transformOrigin="50% 30%";} else if(openAnimation.type=="slideup"){var bottom=0;if(contentDiv.style.bottom){bottom=parseInt(mainDiv.style.height)+2*border+parseInt(contentDiv.style.bottom)+2*padding;} else{bottom=window.innerHeight-parseInt(contentDiv.style.top)+2*border;} var start=bottom;addAnimationClass(OPEN_ANIMATION_SLIDEUP.replace(/\{start\}/g,start+"px"));contentDiv.style.animationName="slideinfrombottom";} else if(openAnimation.type=="slidedown"){var top=0;if(contentDiv.style.top){top=parseInt(contentDiv.style.top)+2*border+2*padding;} else{top=window.innerHeight-parseInt(contentDiv.style.bottom)-parseInt(mainDiv.style.height);} var start=top+parseInt(mainDiv.style.height);addAnimationClass(OPEN_ANIMATION_SLIDEDOWN.replace(/\{start\}/g,"-"+start+"px"));contentDiv.style.animationName="slideinfromtop";} else{contentDiv.className+=' sg-animated '+openAnimation.type;} contentDiv.style.animationDuration=openAnimation.speed+"ms";} function setCloseAnimation() {contentDiv.style.animationTimingFunction="linear";var border=contentBox.borderWidth||0;var padding=contentBox.padding||0;if(closeAnimation.type=="slideleft"){var end=parseInt(mainDiv.style.width)+parseInt(contentDiv.style.left)+2*border+2*padding;addAnimationClass(CLOSE_ANIMATION_SLIDELEFT.replace(/\{end\}/g,"-"+end+"px"));contentDiv.style.animationName="slideouttoleft";} else if(closeAnimation.type=="slideright"){var end=window.innerWidth-parseInt(contentDiv.style.left)+2*border;addAnimationClass(CLOSE_ANIMATION_SLIDERIGHT.replace(/\{end\}/g,end+"px"));contentDiv.style.animationName="slideouttoright";} else if(closeAnimation.type=="pop"){addAnimationClass(CLOSE_ANIMATION_POP);contentDiv.style.animationName="popout";contentDiv.style.transform="scale(0)";contentDiv.style.opacity="0";} else if(closeAnimation.type=="fade"){addAnimationClass(CLOSE_ANIMATION_FADE);contentDiv.style.animationName="fadeout";contentDiv.style.opacity="0";} else if(closeAnimation.type=="flip"){addAnimationClass(CLOSE_ANIMATION_FLIP);contentDiv.style.animationName="flipouttoright";contentDiv.style.transform="rotateY(-90deg) scale(.9)";} else if(closeAnimation.type=="turn"){addAnimationClass(CLOSE_ANIMATION_FLIP);contentDiv.style.animationName="flipouttoright";contentDiv.style.transform="rotateY(-90deg) scale(.9)";contentDiv.style.transformOrigin="0";} else if(closeAnimation.type=="flow"){addAnimationClass(CLOSE_ANIMATION_FLOW);contentDiv.style.animationName="flowouttoright";contentDiv.style.transformOrigin="50% 30%";} else if(closeAnimation.type=="slideup"){var top=0;if(contentDiv.style.top){top=parseInt(contentDiv.style.top)+2*border+2*padding;} else{top=window.innerHeight-parseInt(contentDiv.style.bottom)-parseInt(mainDiv.style.height);} var end=top+parseInt(mainDiv.style.height);addAnimationClass(CLOSE_ANIMATION_SLIDEUP.replace(/\{end\}/g,"-"+end+"px"));contentDiv.style.animationName="slideouttotop";} else if(closeAnimation.type=="slidedown"){var bottom=0;if(contentDiv.style.bottom){bottom=parseInt(mainDiv.style.height)+2*border+parseInt(contentDiv.style.bottom)+2*padding;} else{bottom=window.innerHeight-parseInt(contentDiv.style.top)+2*border;} var end=bottom;addAnimationClass(CLOSE_ANIMATION_SLIDEDOWN.replace(/\{end\}/g,end+"px"));contentDiv.style.animationName="slideouttobottom";} else{contentDiv.className=prefix+'-popup-dialog-main-div-theme-wrapper-'+config.popupTheme+' sg-animated '+closeAnimation.type;} contentDiv.style.animationDuration=closeAnimation.speed+"ms";window.setTimeout(function(){contentDiv.className=prefix+'-popup-dialog-main-div-theme-wrapper-'+config.popupTheme;contentDiv.style.animationName="";contentDiv.style.transform="";contentDiv.style.transformOrigin="";contentDiv.style.opacity="";},parseInt(closeAnimation.speed)+10);} function setOpenEvents() {for(var i=0;i0){scrollPos=document.body.scrollHeight*(scrollPos/100)-window.innerHeight/2;} var scrollEventFunction=function(){if(document.body.scrollTop>=scrollPos||document.documentElement.scrollTop>=scrollPos){openPopup(!1,'onScroll');window.removeEventListener("scroll",scrollEventFunction);}};window.addEventListener("scroll",scrollEventFunction);} function setOpenOnLoadEvent() {if(document.readyState==="complete"){openPopup(!1,'onLoad');} else{window.addEventListener("load",function(){openPopup(!1,'onLoad');},false);}} function setOpenOnClickEvent(config) {var target=config.target;if(!target){return;} var elements=document.getElementsByClassName(target);for(var i=0;i'+popupContent.innerHTML+'
';} if(typeof config.closeButton.type!=='undefined'&&config.closeButton.type=='button'){closeButtonImage=document.createElement(config.closeButton.type);} else{closeButtonImage=document.createElement("IMG");} if(config.closeBehavior.showButton!==false){closeButtonImage.className=prefix+"-popup-close-button-"+config.popupTheme;contentDiv.appendChild(closeButtonImage);} contentDiv.appendChild(mainDiv);DIV.appendChild(contentDiv);document.body.appendChild(DIV);isInited=!0;setOpenEvents();} function getInlineContent() {var divElement=document.createElement("div");divElement.innerHTML='';if(inline){var hrefHtml=document.getElementById(inline);if(hrefHtml.previousElementSibling){SGPopup.inlinePrevTarget={hasPreviousElement:true,node:hrefHtml.previousElementSibling}} else{SGPopup.inlinePrevTarget={hasPreviousElement:false,node:hrefHtml.parentNode}} divElement.appendChild(hrefHtml);return divElement;} return divElement;} function openPopup(forced,action) {if(opened){return;} coockieValue=SGPopup.getCookie(popupId);if(coockieValue){return;} if(showOnce){SGPopup.setCookie(popupId,"true",parseInt(showOnce));} if(!forced){if(shouldOpen&&typeof shouldOpen=="function"){if(!shouldOpen()){return;}}} if(!isInited){initPopup();} opened=!0;var self=this;window.addEventListener("resize",onWindowRsize);if(closeBehavior.contentShouldClose){mainDiv.onclick=closePopup;} setTimeout(function(){if(willOpen&&typeof willOpen=="function"){willOpen();} drawOverlay();DIV.style.display="";positionPopup();setOpenAnimation();setCloseButton(mainDiv);if(didOpen){if(typeof didOpen=="function"){didOpen();}}},openDelay);if(closeBehavior.autoclose&&closeBehavior.autoclose>0){setTimeout(closePopup,closeBehavior.autoclose*1000);} if(closeBehavior.escShouldClose){document.onkeydown=function(e){e=e||window.event;if(e.keyCode==27){closePopup();}};}} function closePopup(forced) {if(!forced){if(shouldClose&&typeof shouldClose=="function"){if(!shouldClose()){return;}}} if(closeBehavior.allowed===false&&forced!=true){return;} if(willClose&&typeof willClose=="function"){willClose();} window.removeEventListener("resize",onWindowRsize);var closeFunction=function() {if(!DIV){return;} DIV.style.display="none";removeOverlay();if(didClose&&typeof didClose=="function"){didClose();opened=!1;} if(resetInlineContent&&typeof resetInlineContent=="function"){resetInlineContent();}};if(closeAnimation.type!="none"&&closeAnimation.speed>0){setCloseAnimation();setTimeout(closeFunction,closeAnimation.speed);} else{closeFunction();}} var resizeBox=function() {var sizeConfig=getSizeConfig();setMainDivStyles(sizeConfig)};this.open=function(forced) {openPopup(forced);};this.init=function() {initPopup();};this.close=function(forced) {closePopup(forced);};this.resize=function() {resizeBox();};this.setOpenDelay=function(delay) {openDelay=delay;if(isInited){initPopup();}};this.getOpenDelay=function() {return openDelay;};this.setOpenAnimation=function(animation) {openAnimation=animation;if(isInited){initPopup();}};this.getOpenAnimation=function() {return openAnimation;};this.setCloseAnimation=function(animation) {closeAnimation=animation;if(isInited){initPopup();}};this.getCloseAnimation=function() {return closeAnimation;};this.setCloseBehavior=function(config) {closeBehavior=config;if(isInited){initPopup();}};this.getCloseBehavior=function() {return closeBehavior;};this.setCloseButton=function(button) {closeButton=button;};this.getCloseButton=function() {return closeButton;};this.setOverlay=function(config) {overlay=config;if(isInited){initPopup();}};this.getOverlay=function() {return overlay;};this.setContentBox=function(config) {contentBox=config;if(isInited){initPopup();}};this.getContentBox=function() {return contentBox;};this.setContents=function(content) {contents=content;if(isInited){initPopup();}};this.getContents=function() {return contents;};this.setPosition=function(config) {position=config;};this.getPosition=function() {return position;};this.setSizingRanges=function(ranges) {sizingRanges=ranges;if(isInited){initPopup();}};this.getSizingRanges=function() {return sizingRanges;};this.setShouldOpen=function(func) {shouldOpen=func;if(isInited){initPopup();}};this.getShouldOpen=function() {return shouldOpen;};this.setWillOpen=function(func) {willOpen=func;if(isInited){initPopup();}};this.getWillOpen=function() {return willOpen;};this.setDidOpen=function(func) {didOpen=func;if(isInited){initPopup();}};this.getDidOpen=function() {return didOpen;};this.setShouldClose=function(func) {shouldClose=func;if(isInited){initPopup();}};this.getShouldClose=function() {return shouldClose;};this.setWillClose=function(func) {willClose=func;if(isInited){initPopup();}};this.getWillClose=function() {return willClose;};this.setDidClose=function(func) {didClose=func;if(isInited){initPopup();}};this.getDidClose=function() {return didClose;};} SGPopup.sendGetRequest=function(url,responseHandler,params) {var req;if(window.XMLHttpRequest){req=new XMLHttpRequest();} else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");} req.onreadystatechange=function(){if(req.readyState==4){if(req.status<400){responseHandler(req,params);}else{}}};req.open("GET",url,true);req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');req.send(null);};SGPopup.getCookie=function(cname) {var name=cname+"=";var ca=document.cookie.split(';');for(var i=0;i 2147483647){ return 2147483627; } return popupZIndex; };SGPBPopup.prototype.prepareOpen=function() { var popupId=this.getPopupId(); var popupData=this.getPopupData(); var popupZIndex=this.getCompatibleZiIndex(popupData['sgpb-popup-z-index']); var popupType=this.popupData['sgpb-type']; this.setUpPopupConfig(); var that=this; var popupConfig=this.getPopupConfig(); this.setPopupDimensions(); if(popupData['sgpb-disable-popup-closing']=='on'){ popupData['sgpb-enable-close-button']='';popupData['sgpb-esc-key']='';popupData['sgpb-overlay-click']=''; } popupData['eventName']=this.eventName; if(SGPBPopup.varToBool(popupData['sgpb-enable-close-button'])){ popupConfig.magicCall('setCloseButtonDelay',parseInt(popupData['sgpb-close-button-delay'])); } popupConfig.magicCall('setShowButton',SGPBPopup.varToBool(popupData['sgpb-enable-close-button'])); var openAnimationSpeed=parseFloat(popupData['sgpb-open-animation-speed'])*1000; var closeAnimationSpeed=parseFloat(popupData['sgpb-close-animation-speed'])*1000;popupConfig.magicCall('setOpenAnimationEffect',popupData['sgpb-open-animation-effect']);popupConfig.magicCall('setCloseAnimationEffect',popupData['sgpb-close-animation-effect']);popupConfig.magicCall('setOpenAnimationSpeed',openAnimationSpeed);popupConfig.magicCall('setCloseAnimationSpeed',closeAnimationSpeed);popupConfig.magicCall('setOpenAnimationStatus',popupData['sgpb-open-animation']);popupConfig.magicCall('setCloseAnimationStatus',popupData['sgpb-close-animation']);popupConfig.magicCall('setContentPadding',popupData['sgpb-content-padding']); if(typeof SgpbRecentSalesPopupType !='undefined'){ if(popupType==SgpbRecentSalesPopupType){ popupZIndex=2147483647;popupConfig.magicCall('setCloseAnimationEffect','fade');popupConfig.magicCall('setCloseAnimationSpeed',1000);popupConfig.magicCall('setCloseAnimationStatus','on'); }} popupConfig.magicCall('setZIndex',popupZIndex);popupConfig.magicCall('setCloseButtonWidth',popupData['sgpb-button-image-width']);popupConfig.magicCall('setCloseButtonHeight',popupData['sgpb-button-image-height']);popupConfig.magicCall('setPopupId',popupId);popupConfig.magicCall('setPopupData',popupData);popupConfig.magicCall('setAllowed',!SGPBPopup.varToBool(popupData['sgpb-disable-popup-closing'])); if(popupData['sgpb-type']==SGPB_POPUP_PARAMS.popupTypeAgeRestriction){ popupConfig.magicCall('setAllowed',false); } popupConfig.magicCall('setEscShouldClose',SGPBPopup.varToBool(popupData['sgpb-esc-key']));popupConfig.magicCall('setOverlayShouldClose',SGPBPopup.varToBool(popupData['sgpb-overlay-click']));popupConfig.magicCall('setScrollingEnabled',SGPBPopup.varToBool(popupData['sgpb-enable-content-scrolling'])); if(SGPBPopup.varToBool(popupData['sgpb-content-click'])){ this.contentCloseBehavior(); } if(SGPBPopup.varToBool(popupData['sgpb-popup-fixed'])){ this.addFixedPosition(); } this.themeCreator(); this.themeCustomizations();popupConfig.magicCall('setContents',document.getElementById('sg-popup-content-wrapper-'+popupId));popupConfig.magicCall('setPopupType',popupType); this.setPopupConfig(popupConfig); this.popupTriggeringListeners(); var allowToOpen=this.checkCurrentPopupType(); if(allowToOpen){ this.open(); }};SGPBPopup.prototype.checkCurrentPopupType=function() { var allowToOpen=!0; var popupConfig=new PopupConfig(); var isPreview=parseInt(this.popupData['sgpb-is-preview']); if(!isNaN(isPreview) && isPreview==1){ return allowToOpen; } var popupHasLimit=this.isSatistfyForShowingLimitation(this.popupData); if(!popupHasLimit){ return !1; } var dontShowPopupCookieName='sgDontShowPopup'+this.popupData['sgpb-post-id']; var dontShowPopup=SGPopup.getCookie(dontShowPopupCookieName); if(dontShowPopup !=''){ return !1; } var className=this.popupData['sgpb-type']; if(typeof className=='undefined'||className=='undefined'){ return !1; } if(typeof SGPB_POPUP_PARAMS.conditionalJsClasses !='undefined' && SGPB_POPUP_PARAMS.conditionalJsClasses.length){ var isAllowConditions=this.isAllowJsConditions(); if(!isAllowConditions){ return !1; }} className=popupConfig.prefix.toUpperCase()+className.firstToUpperCase(); if(window.hasOwnProperty(className)){ className=eval(className); var obj=new className; if(typeof obj.allowToOpen==='function'){ allowToOpen=obj.allowToOpen(this.id); }} return allowToOpen; };SGPBPopup.prototype.isAllowJsConditions=function(){ var conditions=SGPB_POPUP_PARAMS.conditionalJsClasses; var isAllow=!0; for (var i in conditions){ if(!conditions.hasOwnProperty(i)){ break; } try { var className=eval(conditions[i]); } catch (e){ continue; } var obj=new className; if(typeof obj.allowToOpen==='function'){ var allowToOpen=obj.allowToOpen(this.id,this); if(!allowToOpen){ isAllow=allowToOpen;break; }} } return isAllow; };SGPBPopup.prototype.setPopupLimitationCookie=function(popupData) { var cookieData=this.getPopupShowLimitationCookie(popupData); var cookie=cookieData.cookie||{}; var openingCount=cookie.openingCount||0; var currentUrl=window.location.href; if(!popupData['sgpb-show-popup-same-user-page-level']){ currentUrl=''; } cookie.openingCount=openingCount+1;cookie.openingPage=currentUrl; var popupShowingLimitExpiry=popupData['sgpb-show-popup-same-user-expiry'];SGPBPopup.setCookie(cookieData.cookieName,JSON.stringify(cookie),popupShowingLimitExpiry,currentUrl); } SGPBPopup.prototype.isSatistfyForShowingLimitation=function(popupData) { var popupLimitation=popupData['sgpb-show-popup-same-user']; if(!popupLimitation){ return !0; } var cookieData=this.getPopupShowLimitationCookie(popupData); if(!cookieData.cookie){ return !0; } return popupData['sgpb-show-popup-same-user-count'] > cookieData.cookie.openingCount; } SGPBPopup.prototype.getPopupShowLimitationCookie=function(popupData) { var savedCookie=this.getPopupShowLimitationCookieDetails(popupData); var savedCookie=this.filterPopupLimitationCookie(savedCookie); return savedCookie; } SGPBPopup.prototype.filterPopupLimitationCookie=function(cookie) { var result={}; if(cookie.isPageLevel){ result.cookieName=cookie.pageLevelCookieName;result.cookie=jQuery.parseJSON(cookie.pageLevelCookie);SGPBPopup.deleteCookie(cookie.domainLevelCookieName); return result; } result.cookieName=cookie.domainLevelCookieName;result.cookie=jQuery.parseJSON(cookie.domainLevelCookie); var currentUrl=window.location.href;SGPBPopup.deleteCookie(cookie.pageLevelCookieName,currentUrl); return result; } SGPBPopup.prototype.getPopupShowLimitationCookieDetails=function(popupData) { var result=!1; var currentUrl=window.location.href; var currentPopupId=popupData['sgpb-post-id']; var popupLimitationCookieHomePageLevelName='SGPBShowingLimitationHomePage'+currentPopupId; var popupLimitationCookiePageLevelName='SGPBShowingLimitationPage'+currentPopupId; var popupLimitationCookieDomainName='SGPBShowingLimitationDomain'+currentPopupId; var pageLevelCookie=popupData['sgpb-show-popup-same-user-page-level']||false; if(currentUrl==SGPB_POPUP_PARAMS.homePageUrl){ popupLimitationCookiePageLevelName=popupLimitationCookieHomePageLevelName; } var popupLimitationPageLevelCookie=SGPopup.getCookie(popupLimitationCookiePageLevelName); var popupLimitationDomainCookie=SGPopup.getCookie(popupLimitationCookieDomainName);result={ 'pageLevelCookieName':popupLimitationCookiePageLevelName, 'domainLevelCookieName':popupLimitationCookieDomainName, 'pageLevelCookie':popupLimitationPageLevelCookie, 'domainLevelCookie':popupLimitationDomainCookie, 'isPageLevel':pageLevelCookie } return result; } SGPBPopup.prototype.popupLimitation=function(popupData) { var currentUrl=window.location.href; var currentPopupId=popupData['sgpb-post-id']; var popupLimitationCookieHomePageLevelName='SGPBShowingLimitationHomePage'+currentPopupId; var popupLimitationCookiePageLevelName='SGPBShowingLimitationPage'+currentPopupId; var popupLimitationCookieDomainName='SGPBShowingLimitationDomain'+currentPopupId; var popupLimitation=popupData['sgpb-show-popup-same-user']; if(typeof popupLimitation !='undefined' && popupLimitation){ var popupShowingLimit=popupData['sgpb-show-popup-same-user-count']; var popupShowingLimitExpiry=popupData['sgpb-show-popup-same-user-expiry']; var pageLevelCookie=popupData['sgpb-show-popup-same-user-page-level']; if(typeof pageLevelCookie=='undefined'){ pageLevelCookie=''; } if(currentUrl==SGPB_POPUP_PARAMS.homePageUrl){ popupLimitationCookiePageLevelName=popupLimitationCookieHomePageLevelName; } var popupLimitationPageLevelCookie=SGPopup.getCookie(popupLimitationCookiePageLevelName); var popupLimitationDomainCookie=SGPopup.getCookie(popupLimitationCookieDomainName); if(pageLevelCookie){ if(popupLimitationPageLevelCookie==''){ var cookieObject={ openingCount:1, pageLevelCookie:pageLevelCookie, openingPage:currentUrl };SGPBPopup.setCookie(popupLimitationCookiePageLevelName,JSON.stringify(cookieObject),popupShowingLimitExpiry,currentUrl); } else { var popupLimitationPageLevelCookie=jQuery.parseJSON(popupLimitationPageLevelCookie); if(popupShowingLimit <=popupLimitationPageLevelCookie.openingCount){ return !1; } var updatedCount=parseInt(popupLimitationPageLevelCookie.openingCount+1);popupLimitationPageLevelCookie.openingCount=updatedCount;SGPBPopup.setCookie(popupLimitationCookiePageLevelName,JSON.stringify(popupLimitationPageLevelCookie),popupShowingLimitExpiry,currentUrl); } SGPBPopup.deleteCookie(popupLimitationCookieDomainName); } else { if(typeof popupLimitationPageLevelCookie=='undefined'){ popupLimitationPageLevelCookie=''; } if(popupLimitationPageLevelCookie !=''){ var popupLimitationPageLevelCookie=jQuery.parseJSON(popupLimitationPageLevelCookie); } if(popupLimitationPageLevelCookie){ SGPBPopup.deleteCookie(popupLimitationCookiePageLevelName,popupLimitationPageLevelCookie.openingPage); } if(popupLimitationDomainCookie==''){ var cookieObject={ openingCount:1, pageLevelCookie:pageLevelCookie };SGPBPopup.setCookie(popupLimitationCookieDomainName,JSON.stringify(cookieObject),popupShowingLimitExpiry,pageLevelCookie); } else { var popupLimitationDomainCookie=jQuery.parseJSON(popupLimitationDomainCookie); if(popupShowingLimit <=popupLimitationDomainCookie.openingCount){ return !1; } var updatedCount=parseInt(popupLimitationDomainCookie.openingCount+1);popupLimitationDomainCookie.openingCount=updatedCount;SGPBPopup.setCookie(popupLimitationCookieDomainName,JSON.stringify(popupLimitationDomainCookie),popupShowingLimitExpiry,pageLevelCookie); }} } return !0; };SGPBPopup.prototype.themeCreator=function() { var noPositionSelected=!1; var popupData=this.getPopupData(); var popupId=this.getPopupId(); var popupConfig=this.getPopupConfig(); var forceRtlClass=''; var forceRtl=SGPBPopup.varToBool(popupData['sgpb-force-rtl']); var popupTheme=popupData['sgpb-popup-themes']; var popupType=popupData['sgpb-type']; var closeButtonWidth=popupData['sgpb-button-image-width']; var closeButtonHeight=popupData['sgpb-button-image-height']; var contentPadding=parseInt(popupData['sgpb-content-padding']); var contentClass=popupData['sgpb-content-custom-class']; var closeButtonImage=popupConfig.closeButtonImage; var themeNumber=1; var backgroundColor='black'; var recentSalesPopup=!1; if(typeof SgpbRecentSalesPopupType !='undefined'){ if(popupType==SgpbRecentSalesPopupType){ recentSalesPopup=!0;popupTheme='sgpb-theme-2';closeButtonPosition='topRight';backgroundColor='white';popupConfig.magicCall('setShadowSpread',3);popupConfig.magicCall('setContentShadowBlur',5);popupConfig.magicCall('setOverlayVisible',false); }} if(forceRtl){ forceRtlClass=' sgpb-popup-content-direction-right'; } if(popupData['sgpb-type']=='countdown'){ popupConfig.magicCall('setMinWidth',300); } popupConfig.magicCall('setContentPadding',contentPadding);popupConfig.magicCall('setOverlayAddClass',popupTheme+'-overlay sgpb-popup-overlay-'+popupId);popupConfig.magicCall('setContentAddClass','sgpb-content sgpb-content-'+popupId+' '+popupTheme+'-content '+contentClass+forceRtlClass); if(typeof popupData['sgpb-close-button-position']=='undefined'||popupData['sgpb-close-button-position']==''){ var noPositionSelected=!0; } else { var closeButtonPosition=popupData['sgpb-close-button-position'];popupConfig.magicCall('setButtonPosition',closeButtonPosition); } if(popupTheme=='sgpb-theme-1'){ themeNumber=1;popupConfig.magicCall('setShadowSpread',14); if(noPositionSelected||closeButtonPosition=='bottomRight'){ popupConfig.magicCall('setCloseButtonPositionRight','9px');popupConfig.magicCall('setCloseButtonPositionBottom','9px'); } else { popupConfig.magicCall('setCloseButtonPositionLeft','9px');popupConfig.magicCall('setCloseButtonPositionBottom','9px'); }} else if(popupTheme=='sgpb-theme-2'){ themeNumber=2;popupConfig.magicCall('setButtonInside',false);popupConfig.magicCall('setContentBorderWidth',1);popupConfig.magicCall('setContentBackgroundColor',backgroundColor);popupConfig.magicCall('setContentBorderColor','inherit');popupConfig.magicCall('setOverlayColor','white'); var rightPosition='0'; var topPosition='-'+closeButtonHeight+'px'; if(recentSalesPopup){ rightPosition='-'+(closeButtonWidth / 2)+'px';topPosition='-'+(closeButtonHeight / 2)+'px';themeNumber=6; } if(noPositionSelected||closeButtonPosition=='topRight'){ popupConfig.magicCall('setCloseButtonPositionRight',rightPosition);popupConfig.magicCall('setCloseButtonPositionTop',topPosition); } else { if(closeButtonPosition=='topLeft'){ popupConfig.magicCall('setCloseButtonPositionLeft','0');popupConfig.magicCall('setCloseButtonPositionTop','-'+closeButtonHeight+'px'); } else if(closeButtonPosition=='bottomRight'){ popupConfig.magicCall('setCloseButtonPositionRight','0');popupConfig.magicCall('setCloseButtonPositionBottom','-'+closeButtonHeight+'px'); } else if(closeButtonPosition=='bottomLeft'){ popupConfig.magicCall('setCloseButtonPositionLeft','0');popupConfig.magicCall('setCloseButtonPositionBottom','-'+closeButtonHeight+'px'); }} } else if(popupTheme=='sgpb-theme-3'){ themeNumber=3;popupConfig.magicCall('setContentBorderWidth',5);popupConfig.magicCall('setContentBorderRadius',popupData['sgpb-border-radius']);popupConfig.magicCall('setContentBorderRadiusType',popupData['sgpb-border-radius-type']);popupConfig.magicCall('setContentBorderColor',popupData['sgpb-border-color']); if(noPositionSelected){ popupConfig.magicCall('setCloseButtonWidth',38);popupConfig.magicCall('setCloseButtonHeight',19);popupConfig.magicCall('setCloseButtonPositionRight','4px');popupConfig.magicCall('setCloseButtonPositionTop','4px'); } else { if(closeButtonPosition=='topRight'){ popupConfig.magicCall('setCloseButtonPositionRight','4px');popupConfig.magicCall('setCloseButtonPositionTop','4px'); } else if(closeButtonPosition=='topLeft'){ popupConfig.magicCall('setCloseButtonPositionLeft','4px');popupConfig.magicCall('setCloseButtonPositionTop','4px'); } else if(closeButtonPosition=='bottomRight'){ popupConfig.magicCall('setCloseButtonPositionLeft','4px');popupConfig.magicCall('setCloseButtonPositionBottom','4px'); } else if(closeButtonPosition=='bottomLeft'){ popupConfig.magicCall('setCloseButtonPositionLeft','4px');popupConfig.magicCall('setCloseButtonPositionBottom','4px'); }} } else if(popupTheme=='sgpb-theme-4'){ themeNumber=4;popupConfig.magicCall('setButtonImage',popupData['sgpb-button-text']);popupConfig.magicCall('setCloseButtonType','button');popupConfig.magicCall('setCloseButtonText',popupData['sgpb-button-text']);popupConfig.magicCall('setContentBorderWidth',0);popupConfig.magicCall('setContentBackgroundColor','white');popupConfig.magicCall('setContentBorderColor','white');popupConfig.magicCall('setOverlayColor','white');popupConfig.magicCall('setShadowSpread',4);popupConfig.magicCall('setContentShadowBlur',8); if(noPositionSelected||closeButtonPosition=='bottomRight'){ popupConfig.magicCall('setCloseButtonPositionRight','12px');popupConfig.magicCall('setCloseButtonPositionBottom','9px'); } else { popupConfig.magicCall('setCloseButtonPositionLeft','12px');popupConfig.magicCall('setCloseButtonPositionBottom','9px'); }} else if(popupTheme=='sgpb-theme-5'){ themeNumber=5;popupConfig.magicCall('setBoxBorderWidth',10);popupConfig.magicCall('setContentBorderColor','#4B4B4B'); if(noPositionSelected||closeButtonPosition=='bottomRight'){ popupConfig.magicCall('setCloseButtonPositionRight','8px');popupConfig.magicCall('setCloseButtonPositionBottom','8px'); } else { popupConfig.magicCall('setCloseButtonPositionLeft','8px');popupConfig.magicCall('setCloseButtonPositionBottom','8px'); }} else if(popupTheme=='sgpb-theme-6'){ themeNumber=6;popupConfig.magicCall('setButtonInside',false);popupConfig.magicCall('setContentBorderRadius',7);popupConfig.magicCall('setContentBorderRadiusType','px'); if(noPositionSelected){ popupConfig.magicCall('setCloseButtonWidth',37);popupConfig.magicCall('setCloseButtonHeight',37);popupConfig.magicCall('setCloseButtonPositionRight','-18.5px');popupConfig.magicCall('setCloseButtonPositionTop','-18.5px'); } else { if(closeButtonPosition=='topRight'){ popupConfig.magicCall('setCloseButtonPositionRight','-'+(closeButtonWidth / 2)+'px');popupConfig.magicCall('setCloseButtonPositionTop','-'+(closeButtonHeight / 2)+'px'); } else if(closeButtonPosition=='topLeft'){ popupConfig.magicCall('setCloseButtonPositionLeft','-'+(closeButtonWidth / 2)+'px');popupConfig.magicCall('setCloseButtonPositionTop','-'+(closeButtonHeight / 2)+'px'); } else if(closeButtonPosition=='bottomRight'){ popupConfig.magicCall('setCloseButtonPositionRight','-'+(closeButtonWidth / 2)+'px');popupConfig.magicCall('setCloseButtonPositionBottom','-'+(closeButtonHeight / 2)+'px'); } else if(closeButtonPosition=='bottomLeft'){ popupConfig.magicCall('setCloseButtonPositionLeft','-'+(closeButtonWidth / 2)+'px');popupConfig.magicCall('setCloseButtonPositionBottom','-'+(closeButtonHeight / 2)+'px'); }} } popupConfig.magicCall('setPopupTheme',themeNumber); if(!popupData['sgpb-button-image']){ closeButtonImage=SGPB_POPUP_PARAMS.defaultThemeImages[themeNumber]; if(typeof closeButtonImage !='undefined'){ popupConfig.magicCall('setButtonImage','data:image/png;base64,'+closeButtonImage); }} else { popupConfig.magicCall('setButtonImage','data:image/png;base64,'+popupData['sgpb-button-image-data']); }};SGPBPopup.prototype.themeCustomizations=function() { var popupId=this.getPopupId(); var popupData=this.getPopupData(); var popupConfig=this.getPopupConfig(); var contentOpacity=popupData['sgpb-content-opacity']; var contentBgColor=popupData['sgpb-background-color']; if(popupData['sgpb-background-image-data']){ var contentBgImage='data:image/png;base64,'+popupData['sgpb-background-image-data']; } else { var contentBgImage=popupData['sgpb-background-image']; } var showContentBackground=popupData['sgpb-show-background']; var contentBgImageMode=popupData['sgpb-background-image-mode']; var overlayColor=popupData['sgpb-overlay-color']; var popupTheme=popupData['sgpb-popup-themes']; var popupType=popupData['sgpb-type']; if(typeof showContentBackground=='undefined'){ contentBgColor='';contentBgImage='';contentBgImageMode=''; } if(typeof SgpbRecentSalesPopupType !='undefined'){ if(popupType==SgpbRecentSalesPopupType){ showContentBackground='on';contentBgColor=popupData['sgpb-background-color'];contentOpacity=popupData['sgpb-content-opacity']; }} if(contentOpacity){ popupConfig.magicCall('setContentBackgroundOpacity',contentOpacity); } if(contentBgImageMode){ popupConfig.magicCall('setContentBackgroundMode',contentBgImageMode); } if(contentBgImage){ popupConfig.magicCall('setContentBackgroundImage',contentBgImage); } if(contentBgColor){ contentBgColor=SGPBPopup.hexToRgba(contentBgColor,contentOpacity);popupConfig.magicCall('setContentBackgroundColor',contentBgColor); } if(overlayColor){ popupConfig.magicCall('setOverlayColor',overlayColor); } var overlayClasses=popupTheme+'-overlay sgpb-popup-overlay-'+popupId; if(typeof popupData['sgpb-enable-popup-overlay']=='undefined' && !SGPB_JS_PACKAGES.extensions['advanced-closing']){ popupData['sgpb-enable-popup-overlay']=!0; } popupConfig.magicCall('setOverlayVisible',SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])); if(SGPBPopup.varToBool(popupData['sgpb-enable-popup-overlay'])){ popupConfig.magicCall('setOverlayAddClass',overlayClasses+' '+popupData['sgpb-overlay-custom-class']); var overlayOpacity=popupData['sgpb-overlay-opacity']||0.8;popupConfig.magicCall('setOverlayOpacity',overlayOpacity * 100); }};SGPBPopup.prototype.formSubmissionDetection=function(args) { if(args.length){ return !1; } var popupId=args.popupId; var options=SGPBPopup.getPopupOptionsById(popupId); if(!options['sgpb-reopen-after-form-submission']){ return !1; } jQuery('.sgpb-popup-builder-content-'+popupId+' form').submit(function(){ SGPBPopup.setCookie('SGPBSubmissionReloadPopup',popupId); }); };SGPBPopup.prototype.htmlIframeFilterForOpen=function(popupId,popupEventName) { var popupContent=jQuery('.sgpb-content-'+popupId); if(!popupContent.length){ return !1; } popupContent.find('iframe').each(function(){ if(popupEventName !='open'){ if(jQuery(this).closest('.fb_iframe_widget').length){ return !0; } jQuery(this).attr('data-attr-src',src); jQuery(this).attr('src',''); return !0; } else { var src=jQuery(this).attr('data-attr-src'); jQuery(this).attr('src',src); }}); };SGPBPopup.prototype.getSearchDataFromContent=function(content) { var pattern = /\[(\[?)(pbvariable)(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]\*+(?:\[(?!\/\2\])[^\[]\*+)\*+)\[\/\2\])?)(\]?)/gi; var match; var collectedData=[];while (match=pattern.exec(content)){ var currentSearchData=[]; var attributes; var attributesKeyValue=[]; var parseAttributes = /\s(\w+?)="(.+?)"/g;currentSearchData['replaceString']=this.htmlDecode(match[0]);while (attributes=parseAttributes.exec(match[3])){ attributesKeyValue[attributes[1]]=this.htmlDecode(attributes[2]); } currentSearchData['searchData']=attributesKeyValue;collectedData.push(currentSearchData); } return collectedData; };SGPBPopup.prototype.replaceWithCustomShortcode=function(popupId) { var currentHtmlContent=jQuery('.sgpb-content-'+popupId).html(); var searchData=this.getSearchDataFromContent(currentHtmlContent); var that=this; if(!searchData.length){ return !1; } for (var index in searchData){ var currentSearchData=searchData[index]; var searchAttributes=currentSearchData['searchData']; if(typeof searchAttributes['selector']=='undefined'||typeof searchAttributes['attribute']=='undefined'){ that.replaceShortCode(currentSearchData['replaceString'],'');continue; } try { if(!jQuery(searchAttributes['selector']).length){ that.replaceShortCode(currentSearchData['replaceString'],'');continue; }} catch (e){ that.replaceShortCode(currentSearchData['replaceString'],'');continue; } var replaceName=jQuery(searchAttributes['selector']).attr(searchAttributes['attribute']); if(typeof replaceName=='undefined'){ that.replaceShortCode(currentSearchData['replaceString'],'');continue; } that.replaceShortCode(currentSearchData['replaceString'],replaceName,popupId); }};SGPBPopup.prototype.replaceShortCode=function(shortCode,replaceText,popupId) { var popupId=parseInt(popupId); if(!popupId){ return !1; } var popupContentWrapper=jQuery('.sgpb-content-'+popupId); if(!popupContentWrapper.length){ return !1; } popupContentWrapper.find('div').each(function(){ var currentHtmlContent=jQuery(this).contents(); if(!currentHtmlContent.length){ return !1; } for (var index in currentHtmlContent){ var currentChild=currentHtmlContent[index]; var currentChildNodeValue=currentChild.nodeValue; var currentChildNodeType=currentChild.nodeType; if(currentChildNodeType !=Node.TEXT_NODE){ continue; } if(currentChildNodeValue.indexOf(shortCode)!=-1){ currentChild.nodeValue=currentChildNodeValue.replace(shortCode,replaceText); }} }); return !0; };SGPBPopup.prototype.popupTriggeringListeners=function() { var that=this; var popupData=this.getPopupData(); var popupConfig=this.getPopupConfig();sgAddEvent(window,'sgpbDidOpen',function(e){ var args=e.detail;that.formSubmissionDetection(args); var popupOptions=args.popupData; if(popupOptions['sgpb-show-popup-same-user']){ that.setPopupLimitationCookie(popupOptions); } if(typeof SGPB_ANALYTICS_PARAMS=='undefined'){ if(that.getCountPopupOpen()){ that.addToCounter(popupOptions); }} var closeButtonDelay=parseInt(popupOptions['sgpb-close-button-delay']); if(closeButtonDelay){ that.closeButtonDisplay(popupOptions['sgpb-post-id'],'show',closeButtonDelay); } var disablePageScrolling=popupOptions['sgpb-disable-page-scrolling']; if(popupOptions['sgpb-overlay-color']){ jQuery('.sgpb-theme-1-overlay').css({'background-image':'none'}); } if(SGPBPopup.varToBool(disablePageScrolling)){ jQuery('html').addClass('sgpb-overflow-hidden'); }});sgAddEvent(window,'sgpbWillOpen',function(e){ var args=e.detail; var popupId=parseInt(args['popupId']);that.htmlIframeFilterForOpen(args.popupId,'open');that.replaceWithCustomShortcode(popupId);that.sgpbDontShowPopup(popupId); var closeButtonDelay=parseInt(popupData['sgpb-close-button-delay']); if(closeButtonDelay){ that.closeButtonDisplay(popupData['sgpb-post-id'],'hide'); }});sgAddEvent(window,'sgpbShouldClose',function(e){ });sgAddEvent(window,'sgpbWillClose',function(e){ var args=e.detail;that.htmlIframeFilterForOpen(args.popupId,'close');SGPBPopup.offPopup(e.detail.currentObj); }); };SGPBPopup.prototype.sgpbDontShowPopup=function(popupId) { var dontShowPopup=jQuery('.sgpb-content-'+popupId).parent().find('[class*="sg-popup-dont-show"]'); if(!dontShowPopup.length){ return !1; } dontShowPopup.each(function(){ jQuery(this).bind('click',function(e){ e.preventDefault(); var expireTime=SGPB_POPUP_PARAMS.dontShowPopupExpireTime; var cookieName='sgDontShowPopup'+popupId; var classNameSearch=jQuery(this).attr('class').match(/sg-popup-dont-show/); var className=classNameSearch['input']; var customExpireTime=className.match(/sg-popup-dont-show-(\d+$)/); if(customExpireTime){ expireTime=parseInt(customExpireTime[1]); } SGPBPopup.setCookie(cookieName,expireTime,expireTime);SGPBPopup.closePopupById(popupId); });}); } SGPBPopup.prototype.addToCounter=function(popupOptions) { if(SGPB_POPUP_PARAMS.isPreview !=''){ return !1; } var params={}; var popupId=parseInt(popupOptions['sgpb-post-id']);params.popupId=popupId; var data={ action:'sgpb_send_to_open_counter', nonce:SGPB_JS_PARAMS.nonce, params:params }; jQuery.post(SGPB_JS_PARAMS.ajaxUrl,data,function(res){ }); };SGPBPopup.prototype.closeButtonDisplay=function(popupId,display,delay) { if(display=='show'){ setTimeout(function(){ jQuery('.sgpb-content-'+popupId).prev().show(); }, delay * 1000 /* received values covert to milliseconds */ ); } else if(display=='hide'){ jQuery('.sgpb-content-'+popupId).prev().hide(); }};SGPBPopup.prototype.open=function(args) { var config=this.getPopupConfig(); var popupId=this.getPopupId(); var eventName=this.eventName; if(typeof window.sgPopupBuilder=='undefined'){ window.sgPopupBuilder=[]; } var popupData=SGPBPopup.getPopupWindowDataById(popupId); if(!popupData){ window.SGPB_ORDER +=1; var currentObj={ 'eventName':eventName, 'popupId':popupId, 'order':window.SGPB_ORDER, 'isOpen':true };config.currentObj=currentObj; var popupConfig=config.combineConfigObj(); var popup=new SGPopup(popupConfig);currentObj.popup=popup;window.sgPopupBuilder.push(currentObj); } else { popup=popupData['popup'];popupData['isOpen']=!0; } if(typeof args !='undefined' && !args['countPopupOpen']){ this.setCountPopupOpen(!1); } popup.open(); this.setPopupObj(popup); var options=SGPBPopup.getPopupOptionsById(popupId); if(typeof options['sgpb-behavior-after-special-events'] !='undefined'){ if(options['sgpb-behavior-after-special-events'].length){ options=options['sgpb-behavior-after-special-events'][0][0]; if(options['param']=='contact-form-7'){ SgpbEventListener.processCF7MailSent(popupId,options); }} }};SGPBPopup.varToBool=function(optionName) { var returnValue=optionName ? true:!1; return returnValue; };SGPBPopup.hexToRgba=function(hex,opacity) { var c; if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){ c=hex.substring(1).split(''); if(c.length==3){ c=[c[0],c[0],c[1],c[1],c[2],c[2]]; } c='0x'+c.join(''); return 'rgba('+[(c>>16)&255,(c>>8)&255,c&255].join(',')+','+opacity+')'; } throw new Error('Bad Hex'); };SGPBPopup.prototype.contentCopyToClick=function() { var popupData=this.getPopupData(); var popupId=this.getPopupId(); var textAreaId='content-copy-to-click-'+popupId; var value=this.htmlDecode(popupData['sgpb-copy-to-clipboard-text']); var textArea=jQuery('